<include file="__THEME__/header" />
<link href="../Public/css/space.css" rel="stylesheet" type="text/css" />
<script>
var uid = '{$uid}';
var notify_num = '{$space['notify']['count']}';
//回复留言
function doreplaywall(fid){
	var content = $.trim($("#replay_content_"+fid).val());
	if(content){
		$.post('index.php?app=space&mod=Wall&act=dowall',{touid:uid,fid:fid,content:content},function(result){
			result = eval("("+result+")");
			var html = '<div class="appra"><div class="headpic50 L">'
					 + '<a href="__APP__&mod=View&uid='+result.fromuid+'"><img src="'+result.userface+'" /></a></div>'
	        		 + '<div class="LC2">'
	       			 + '<p class="bg01 pl5"><a href="__APP__&mod=View&uid='+result.fromuid+'">'+result.username+'</a> {:L(index_0001)}</p>'
	        		 + '<p class="pl10 lh30">'+result.content+'</p>'
	      			 + '</div><div class="C"></div></div>';
			$("#replay_content_"+fid).val('');
			$("#doreplay_"+fid).hide();
	        $("#doreplay_"+fid).before(html);
		});
	}else{
		$.tbox.no('{:L(index_0002)}', '{:L(index_0003)}');
	}
}

//删除留言
function dodelwall(id){
	if(confirm('{:L(index_0005)}')){
		$.post('__APP__&mod=Wall&act=dodel',{id:id},function(result){
			$("#wall_"+id).remove();
		});
	}
}

//添加记录
function doadd(){
	var content = $.trim($("#record_contend").val());
	if(content){
		$.post('__APP__&mod=Record&act=doadd',{content:content},function(result){
			if(result){
				var html=content+'<span class="ml10 f12 cl06">{:L(index_0001)}</span>';
				$('#record_show').html(html);
				$("#record_contend").val('');
			}else{

			}
		});
	}else{
		$.tbox.no('{:L(index_0009)}', '{:L(index_0003)}');
	}
}

//删除通知
function delNotify(id){
	$.post('index.php?mod=message&act=dedelnotify',{id:id},function(txt){
		if(txt){
			$("#notify_"+id).slideUp("fast",function(){
				$(this).remove();
			});
		}else{
			alert('{:L(index_0012)}');
		}
	});
}

function setNotifyRead(id){
	$.post('index.php?mod=message&act=setnotify',{id:id,type:'setread'},function(txt){	
		if(txt){
			notify_num = notify_num -1;
			
			if(notify_num==0){
				$('#notify').slideUp("fast",function(){
					$(this).remove();
				});		
			}else{
				$("#notify_count").html(notify_num);
				$("#notify_"+id).slideUp("fast",function(){
					$(this).remove();
				});		
			}
		}else{
			alert('{:L(index_0013)}');
		}
	});
}

$(document).ready(function(){
	$("ul[rel='tab'] li").click(function(){
		$.each( $("ul[rel='tab'] li") , function(i, n){
			$(this).removeClass('on');
		});
		$(this).addClass('on');
		loadfeed($(this).attr('condition'));
	})
	loadfeed('all');
});

function loadfeed(type){
	$('#feed_list_content').html('<ul><li style="text-align:center"><img src="__PUBLIC__/images/loading_blue_big.gif"></li></ul>');
	$.post("{:U('home/User/feed')}",{type:type},function(txt){
		$("#
		  ").html(txt);
	});	
}
</script>
<div class="contents lbg B">
  <!--左边信息 begin-->
  <include file="../Public/left" />
  <!--中间信息 begi-->
  <div class="contents_min w787">
      <div class="tab" >
        <ul rel="tab">
          <li class="on" condition="all">
            <span >{:L(index_0016)}</span>
          </li>
        </ul>
      </div>
      <div>
      <div class="sidebar_R">
        <dl class="FSort mt20">
          <dt>{:L(index_0017)}</dt>
          <php>$spage=($_GET['p'])?'&p='.$_GET['p']:''</php>
          <dd 
          
          <eq name="d" value="">class="ic"</eq>
          ><a href="{:U('home/record/'.ACTION_NAME)}{$spage}">{:L(index_0018)}</a>
          </dd>
          <dd 
          
          <eq name="d" value="today">class="ic"</eq>
          ><a href="{:U('home/record/'.ACTION_NAME,'d=today')}{$spage}">{:L(index_0019)}</a>
          </dd>
          <dd 
          
          <eq name="d" value="weekday">class="ic"</eq>
          ><a href="{:U('home/record/'.ACTION_NAME,'d=weekday')}{$spage}">{:L(index_0020)}</a>
          </dd>
          <dd 
          
          <eq name="d" value="month">class="ic"</eq>
          ><a href="{:U('home/record/'.ACTION_NAME,'d=month')}{$spage}">{:L(index_0021)}</a>
          </dd>
        </dl>
      </div>
      <div>
        <ul id="wall_list" class="book">
          <volist id="vo" name="space['walls']">
            <li id="wall_{$vo.id}" class="Fli">
              <div>
                <div class="headpic50 L"><a href="{:U('space/view','uid='.$vo[fromuid])}"><img src="{$vo.fromuid|getUserFace='s'}" width="50" /></a></div>
                <div class="LC">
                  <p class="bg01 pl5"><span class="R pr10">
                    <php>if($vo['uid']==$mid){</php>
                    <a href="javascript:void(0)" onclick='$("#doreplay_{$vo.id}").show()'>{:L(index_0022)}</a> <a href="javascript:void(0)" onclick="dodelwall({$vo.id})">{:L(index_0023)}</a>
                    <php>}</php>
                    </span> <a href="{:U('space/view','uid='.$vo[fromuid])}">{$vo.fromuid|getUserName}</a> {$vo.cTime|friendlyDate}
                    <eq name="vo['stealth']" value="1"><font color="red">【{:L(index_0024)}】</font></eq>
                  </p>
                  <p class="pl10 lh30"> {$vo.content} </p>
                </div>
                <div id="replaylist_{$vo.id}">
                  <volist id="svo" name="vo['reply']">
                    <div class="appra">
                      <div class="headpic50 L"><a href="{:U('space/view','uid='.$svo[fromuid])}"><img src="{$svo.fromuid|getUserFace='s'}" width="50" /></a></div>
                      <div class="LC1">
                        <p class="bg01 pl5"><a href="{:U('space/view','uid='.$svo[fromuid])}">{$svo.fromuid|getUserName}</a> {$svo.cTime|friendlyDate}</p>
                        <p class="pl10 lh30">{$svo.content}</p>
                      </div>
                      <div class="C"></div>
                    </div>
                  </volist>
                  <div id="doreplay_{$vo.id}" style="display:none" class="appra">
                    <div class="headpic50 L"><img src="{$mid|getUserFace='s'}" width="50"/></div>
                    <div class="LC2" >
                      <textarea name="replay_content_{$vo.id}" id="replay_content_{$vo.id}" class="w430_tx line"></textarea><br />
                      <input class="btn_sea" name="" onclick="doreplaywall({$vo.id})" type="button" value="{:L(index_0022)}" />
                      <input class="btn_sea" name="" onclick='$("#doreplay_{$vo.id}").hide()' type="button" value="{:L(index_0025)}" />
                    </div>
                  </div>
                </div>
              </div>
            </li>
          </volist>
        </ul>
        <p class="C"></p>
        <p class="page mt5 alR mb20"> {$page} </p>
      </div>
  </div>
  </div>
  <div class="C"></div>
</div>
<include file="__THEME__/footer" /> 